package blog.controller;



import blog.service.client.BlogClientService;
import blog.vo.back.ByBlogUuidGetNoneHighlightBlogInfoVO;
import blog.vo.back.ByTagUuidGetNoneHighlightBlogInfoVO;
import blog.vo.client.BlogVO;
import blog.vo.client.ByBlogUuidAndHighlightBlogInfoVO;
import blog.vo.common.PaginationVO;
import blog.vo.common.ResponseListObjectVO;
import blog.vo.common.ResponseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 　　* @description: TODO
 * 　　* @param
 * 　　* @return
 * 　　* @throws
 * 　　* @author Administrator
 * 　　* @date $ $
 *
 */
@RestController
@RequestMapping("/blog")
public class BlogController {
    @Autowired
    private BlogClientService blogClientService;

    @GetMapping("/get-none-highlight-blog")
    public ResponseListObjectVO<BlogVO> getNoneHighlightBlog(PaginationVO paginationVO){
        List<BlogVO> noneHighlightBlog = blogClientService.getNoneHighlightBlog(paginationVO);
        if (noneHighlightBlog == null){
            new ResponseListObjectVO<BlogVO>(500,"没有任何数据",null);
        }
        return new ResponseListObjectVO<BlogVO>(200,"ok",noneHighlightBlog);
    }

    @GetMapping("/get-all-root-highlight-blogInfo")
    public ResponseListObjectVO<BlogVO> getAllRootHighlightBlogInfo(PaginationVO paginationVO){
        List<BlogVO> allRootHighlightBlogInfo = blogClientService.getAllRootHighlightBlogInfo(paginationVO);
        if (allRootHighlightBlogInfo == null){
            new ResponseListObjectVO<BlogVO>(500,"没有任何数据",null);
        }
        return new ResponseListObjectVO<BlogVO>(200,"ok",allRootHighlightBlogInfo);
    }

    @PostMapping("/by-tagUuid-get-none-highlight-blog-info")
    public ResponseListObjectVO<BlogVO> byTagUuidGetNoneHighlightBlogInfo(@RequestBody ByTagUuidGetNoneHighlightBlogInfoVO byTagUuidGetNoneHighlightBlogInfoVO){
        List<BlogVO> byTagUuidGetNoneHighlightBlogInfo = blogClientService.byTagUuidGetNoneHighlightBlogInfo(byTagUuidGetNoneHighlightBlogInfoVO);
        if (byTagUuidGetNoneHighlightBlogInfo == null){
            new ResponseListObjectVO<BlogVO>(500,"没有任何数据",null);
        }
        return new ResponseListObjectVO<BlogVO>(200,"ok",byTagUuidGetNoneHighlightBlogInfo);
    }

    @PostMapping("/by-blog-uuid-and-highlight-blog-info")
    public ResponseVO<BlogVO> byBlogUuidAndHighlightBlogInfo(@RequestBody ByBlogUuidAndHighlightBlogInfoVO byBlogUuidAndHighlightBlogInfoVO){
        BlogVO blogUuidAndHighlightBlogInfo = blogClientService.byBlogUuidAndHighlightBlogInfo(byBlogUuidAndHighlightBlogInfoVO);
        if (blogUuidAndHighlightBlogInfo == null){
            new ResponseVO<BlogVO>(500,"没有任何数据",null);
        }
        return new ResponseVO<BlogVO>(200,"ok",blogUuidAndHighlightBlogInfo);
    }
}
